home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer)…68k, x86, SPARC, PA-RISC] / NeXTSTEP 3.3 Dev Intel.iso / NextDeveloper / Headers / bsd / netinet / ip_mroute.h < prev    next >
C/C++ Source or Header  |  1995-02-14  |  2KB  |  80 lines

  1. /*
  2.  * Definitions for the kernel part of DVMRP,
  3.  * a Distance-Vector Multicast Routing Protocol.
  4.  * (See RFC-1075.)
  5.  *
  6.  * Written by David Waitzman, BBN Labs, August 1988.
  7.  * Modified by Steve Deering, Stanford, February 1989.
  8.  *
  9.  * MROUTING 1.0
  10.  */
  11.  
  12.  
  13. /*
  14.  * DVMRP-specific setsockopt commands.
  15.  */
  16. #define DVMRP_INIT        100
  17. #define DVMRP_DONE        101
  18. #define DVMRP_ADD_VIF    102
  19. #define DVMRP_DEL_VIF    103
  20. #define DVMRP_ADD_LGRP    104
  21. #define DVMRP_DEL_LGRP    105
  22. #define DVMRP_ADD_MRT    106
  23. #define DVMRP_DEL_MRT    107
  24.  
  25.  
  26. /*
  27.  * Types and macros for handling bitmaps with one bit per virtual interface.
  28.  */
  29. #define MAXVIFS 32
  30. typedef u_long vifbitmap_t;
  31. typedef u_short vifi_t;        /* type of a vif index */
  32.  
  33. #define    VIFM_SET(n, m)        ((m) |=  (1 << (n)))
  34. #define    VIFM_CLR(n, m)        ((m) &= ~(1 << (n)))
  35. #define    VIFM_ISSET(n, m)    ((m) &   (1 << (n)))
  36. #define VIFM_CLRALL(m)        ((m) = 0x00000000)
  37. #define VIFM_COPY(mfrom, mto)    ((mto) = (mfrom))
  38. #define VIFM_SAME(m1, m2)    ((m1) == (m2))
  39.  
  40.  
  41. /*
  42.  * Agument structure for DVMRP_ADD_VIF.
  43.  * (DVMRP_DEL_VIF takes a single vifi_t argument.)
  44.  */
  45. struct vifctl {
  46.     vifi_t        vifc_vifi;            /* the index of the vif to be added   */
  47.     u_char        vifc_flags;            /* VIFF_ flags defined below          */
  48.     u_char        vifc_threshold;        /* min ttl required to forward on vif */
  49.     struct in_addr  vifc_lcl_addr;  /* local interface address            */
  50.     struct in_addr  vifc_rmt_addr;  /* remote address (tunnels only)      */
  51. };
  52.  
  53. #define VIFF_TUNNEL      0x1            /* vif represents a tunnel end-point */
  54.  
  55.  
  56. /*
  57.  * Argument structure for DVMRP_ADD_LGRP and DVMRP_DEL_LGRP.
  58.  */
  59. struct lgrplctl {
  60.     vifi_t         lgc_vifi;
  61.     struct in_addr lgc_gaddr;
  62. };
  63.  
  64.  
  65. /*
  66.  * Argument structure for DVMRP_ADD_MRT.
  67.  * (DVMRP_DEL_MRT takes a single struct in_addr argument, containing origin.)
  68.  */
  69. struct mrtctl {
  70.     struct in_addr  mrtc_origin;        /* subnet origin of multicasts      */
  71.     struct in_addr  mrtc_originmask;    /* subnet mask for origin           */
  72.     vifi_t        mrtc_parent;            /* incoming vif                     */
  73.     vifbitmap_t        mrtc_children;        /* outgoing children vifs           */
  74.     vifbitmap_t        mrtc_leaves;        /* subset of outgoing children vifs */
  75. };
  76.  
  77.  
  78.  
  79.  
  80.